/******************************************************************************

    Simple Authentication and Authorisation System (SAAS)

    tests.h

    Copyright (C) 2011  Josh Goes


    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

    If you require a mailing address for this software, please send your
    mail to the following address:
        SAAS
        GPO Box 2973
        BRISBANE QLD 4001
        AUSTRALIA

******************************************************************************/


#ifndef _H_0e2efb133f78bdb76aa1b9973c15f4f6
#define _H_0e2efb133f78bdb76aa1b9973c15f4f6



#include <stdint.h>


#define SAAS_TEST_VAR_TYPE_STR             0x01
#define SAAS_TEST_VAR_TYPE_UINT8           0x02
#define SAAS_TEST_VAR_TYPE_SINT8           0x03
#define SAAS_TEST_VAR_TYPE_UINT16          0x04
#define SAAS_TEST_VAR_TYPE_SINT16          0x05
#define SAAS_TEST_VAR_TYPE_UINT32          0x06
#define SAAS_TEST_VAR_TYPE_SINT32          0x07
#define SAAS_TEST_VAR_TYPE_UINT64          0x08
#define SAAS_TEST_VAR_TYPE_SINT64          0x09


struct st_saas_test_opt
{
	// the long version of an option
	char           *long_name;

	// the short version of an option
	char           *short_name;

	// 0 = no arg, 1 = required arg, 2 = optional arg
	uint8_t         has_arg;

	// callback function for this argument
	void ( * callback )( const char *long_name , const char *opt );

	// pointer to the variable they may want altered.
	void *var;

	// the type of variable
	uint8_t  var_type;

	// value to go into the variable if it's an integer.
	int var_int_val;
	char *var_str_val;
	int   var_str_len;
};


uint16_t  saas_get_opts( struct st_saas_test_opt *opts , int argc , char **argv );



#endif // _H_0e2efb133f78bdb76aa1b9973c15f4f6
